<?php

require_once "fromrcon.php";

// 设置要查询的服务器
$serverip   = $_GET["ds_ip"];
$serverport = $_GET["ds_port"];

$server = new Rcon();
$server->Connect($serverip, $serverport);


$servercon = $server->ServerInfo();

if($servercon)
    $server_online = true;
else
    $server_online = false;

?>


<!--<!DOCTYPE html>-->
<!--<html lang="en">-->
<!--<head>-->
<!--    <meta charset="UTF-8">-->
<!--    <meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<!--    <meta name="viewport" content="width=device-width, initial-scale=1.0">-->
<!--    <meta charset="uft-8">-->
<!--    <title>Xash服务器在线查询</title>-->
<!--    <link rel="shortcut icon" href="./assets/images/logo-xash.png" type="image/x-icon">-->
<!--     <link rel="stylesheet" href="assets/css/style.css"> -->
<!--</head>-->
<!--<body>-->
<!--      <h6>服务器类型:</h6>  -->
<!--      <h4><?php if($server_online) echo $servercon["game"]; else echo "没有查询到"; ?></h4>-->
<!--      <h6>服务器名称:</h6>  -->
<!--      <h4><?php if($server_online) echo $servercon["name"]; else echo "没有查询到"; ?></h4>-->
<!--      <h6>服务器状态:</h6>-->
<!--      <h4><?php if($server_online) echo "在线"; else echo "离线"; ?></h4>-->
<!--      <h6>在线玩家:</h6>-->
<!--      <h4><?php if($server_online) { echo $servercon["activeplayers"] . "/" . $servercon["maxplayers"]; } else { echo "Unknown"; } ?></h4>-->
<!--      <h6>当前地图:</h6>-->
<!--      <h4><?php if($server_online) { echo $servercon["map"]; } else { echo "Unknown"; } ?></h4>-->
<!--</body>-->
<!--</html>-->
